
#include "pedro_tools.h"


CBucle_wait::CBucle_wait(int waitini)
{
    m_wait = waitini;
    m_key=0;
}


int CBucle_wait::bucle_cvWaitKey(void)
{	
    int key;
    key = cvWaitKey(*wait) ;
    key = key & (0x0FFFFF ^ 0x020000);

    if(key == 'Q' || key == 'q')
    {
	key = -1;
    }
    if (key>='0' && key <='9')
    {
	m_wait = (key-(int)'0')*(key-(int)'0')*10;
	key = 0;
    }
    else if (key == ' ')
    {
	m_wait =0;
	key = 0;
    }
    else if (key == 917503)
	key = 0;

    m_key = key;
    return m_key;
}
